const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  transpileDependencies: [],
  productionSourceMap: false,
  css: {
    extract: false
  },
  configureWebpack: {
    optimization: {
      minimize: false
    },
    target: 'web',
    mode: 'development',
    devtool: false,
    externals: {},
    module: {
      rules: [
        {
          test: /\.js$/,
          exclude: /node_modules/,
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env'],
            plugins: [],
          },
        },
      ],
    },
  },
  chainWebpack: config => {
    // 禁用代码分块和模块转换
    config.optimization.minimize(false);
    // 配置模块加载器
    config.module
      .rule('js')
      .exclude.add(/node_modules/)
      .end()
      .use('babel-loader')
      .loader('babel-loader')
      .tap(options => {
        options.plugins = [];
        return options;
      });
  }
});
